package main

import (
	"fmt"
	"reflect"
	"stack"
)

func main() {
	s := new(stack.StackAny)
	s.Push(14.55)
	s.Push("Are you OK?")
	s.Push(153)
	s.Push([]string{"Java", "Python", "C++", "Javascript", "Node"})

	fmt.Println("stack: ", s)
	if a, err := s.Top(); err == nil {
		fmt.Println("the top of stack: ", a)
	} else {
		fmt.Println("get top of Stack error: ", err.Error())
	}

	for {
		d, err := s.Pop()
		if err != nil {
			fmt.Println(err.Error())
			break
		}
		t := reflect.TypeOf(d)
		fmt.Println("item: ", d)
		fmt.Println("item's type: ", t)
		fmt.Println("stack: ", s)
	}
}
